﻿$.MGJ.Records = [];
(function () {
    var _this = $.MGJ.Records;
    $.extend($.MGJ.Records, {


    });
})(jQuery);
(function () {
    var _this = $.MGJ.Records;
    $.extend($.MGJ.Records, {
        Ajax_List: function (pageIndex) {
            var key = $("#psearch").val();
            $.L.ajaxHandle({
                url: ACTION_URL("RecordsList", "FleeGoods"),
                data: {
                    key: key,
                    pageIndex: pageIndex,
                    pageSize: 10
                },
                success: function (response) {
                    if (response == 1) {
                        $.L.msgError("该物流码不属于当前企业")
                    } else if (response == 0) {
                        $.L.msgError("该物流码不存在！")
                    }
                    $("#ListBoxInfo").L_bindingDataList(response);
                },
            });
        },

        Ajax_OutList: function () {
            var key = $("#psearch").val();
            var reg = /^[A-Za-z0-9]{6,}$/;
            if (key != "") {
            if (!reg.test(key)) {
                $.L.msgError('物流码不能少于6位！');
            }
                $.L.ajaxHandle({
                    url: ACTION_URL("OutRecordsList", "FleeGoods"),
                    data: {
                        key: key,
                    },
                    success: function (response) {
                        if (response == 1) {
                            $.L.msgError("该物流码不属于当前企业")
                        } else if (response == 0) {
                            $.L.msgError("该物流码尚不存在出库信息！")
                        }
                        else if (response == 2) {
                            $.L.msgError("该物流码尚不存在出库信息！")
                        }
                        $("#ListBoxInfo").L_bindingDataList(response);

                    }
                });
            } else {
                 if (arguments[0] != "Initing") {
                     $.L.msgError("查询码不能为空");

                 }
                $("#ListBoxInfo").L_bindingDataList([]);

            }
       },

        Ajax_OurLife: function () {
            var key = $("#psearch").val();
            var reg = /^[A-Za-z0-9]{6,}$/;        
                if(key!=""){
                    if (!reg.test(key)) {
                        $.L.msgError('物流码不能少于6位！');
                    }
                $.L.ajaxHandle({
                    url: ACTION_URL("OurLifeList", "FleeGoods"),
                    data: {
                        key: key,
                    },
                    success: function (response) {
                        if (response == 1) {
                            $.L.msgError("该物流码不属于当前企业")
                            return;
                        } else if (response == 0) {
                            $.L.msgError("该物流码不存在！")
                            return;
                        }
                        else if (response == 2) {
                            $.L.msgError("该物流码的履历不存在！")
                            return;
                        }
                       
                        $("#ListBoxInfo").L_bindingDataList(response);

                    }
                });
                } else {
                    if (arguments[0] != "Initing") {
                        $.L.msgError("查询码不能为空");

                    }
                    $("#ListBoxInfo").L_bindingDataList([]);

                }
        },
    });
})(jQuery);
(function () {
    var _this = $.MGJ.Records;
    $.extend($.MGJ.Records, {


    });
})(jQuery);